package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Formula;
/**
 * 任务管理
 */
@Entity
@Table
public class Task implements Serializable {

	
	private static final long serialVersionUID = 3435152275681850971L;
	
	
	private Integer code;
	private Integer oc;					// 机构编号
	private Integer user;				// 创建者编号
	private String content;				// 内容
	private Integer ts;					// 任务状态
	private String remark;				// 备注
	private Boolean deleted;
	private Date start;					// 开始时间
	private Date end;					// 结束时间
	private Date rt;					// 提醒时间
	private Integer du;					// 指派人
	private Integer ru;					// 接收人
	private String title;				// 标题
	private Boolean fettle;				// 任务是否完成
	
	private String duser;
	private String ruser;
	private String un;					// 创建者姓名
	
	
	
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Integer getUser() {
		return user;
	}
	@Column(length = 1000)
	public String getContent() {
		return content;
	}
	@Column
	public Integer getTs() {
		return ts;
	}
	@Column(length = 200)
	public String getRemark() {
		return remark;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getStart() {
		return start;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getEnd() {
		return end;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column
	public Date getRt() {
		return rt;
	}
	@Column
	public Integer getDu() {
		return du;
	}
	@Column(length = 50)
	public String getTitle() {
		return title;
	}
	@Column
	public Integer getRu() {
		return ru;
	}
	@Formula("(SELECT ui.realName FROM UserInfo ui WHERE ui.code = ru)")
	public String getRuser() {
		return ruser;
	}
	@Formula("(SELECT ui.realName FROM UserInfo ui WHERE ui.code = du)")
	public String getDuser() {
		return duser;
	}
	@Column
	public Boolean getFettle() {
		return fettle;
	}
	@Formula("(SELECT ui.realName FROM UserInfo ui WHERE ui.code = user)")
	public String getUn() {
		return un;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	public void setRt(Date rt) {
		this.rt = rt;
	}
	public void setUn(String un) {
		this.un = un;
	}
	public void setFettle(Boolean fettle) {
		this.fettle = fettle;
	}
	public void setRu(Integer ru) {
		this.ru = ru;
	}
	public void setRuser(String ruser) {
		this.ruser = ruser;
	}
	public void setDuser(String duser) {
		this.duser = duser;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setUser(Integer user) {
		this.user = user;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public void setTs(Integer ts) {
		this.ts = ts;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setStart(Date start) {
		this.start = start;
	}
	public void setEnd(Date end) {
		this.end = end;
	}
	public void setDu(Integer du) {
		this.du = du;
	}
	
	
}
